<?php 

require(ROOT_PATH.'/include/Action.php');

class Action extends mainAction
{
	public $adminid		= 0;
	public $adminrs;
	
	public function chushe()
	{
		if(M!='first' && !file_exists(DB_HOST))
			exit('<font color=red>系统未初始化</font>，点我去<a href="index.php?m=first">初始化</a>');
	}
	
	public function initProject()
	{
		$this->chushe();
		$this->adminid		= (int)$this->getsession('adminid',0);
		if($this->adminid==0)$this->rock->location('?m=login');
		$this->getAdmininfo($this->adminid);
	}
	
	public function getAdmininfo($uid)
	{
		$this->adminid  = $uid;
		$this->adminrs	= m('users')->getone("`id`='$uid'");
		if(isempt($this->adminrs['face']))$this->adminrs['face'] = 'images/noface.png';
		$this->assign('adminrs', $this->adminrs);
	}
	
	public function returnerror($msg='')
	{
		return returnerror($msg);
	}
	
	public function returndata($data=array())
	{
		return returnsuccess($data);
	}
	
	
}

class ActionNot extends Action
{
	public function initProject()
	{
		$this->chushe();
	}
}